Jenkins

Gerrit Trigger Plugin

This plugin is used for integrating Jenkins with Gerrit. A job can be built based on the condition of a project on Gerrit server. For example, a job is built whenever a new patchset is committed.

Install Gerrit Trigger

  1. Click on the manage Jenkins button

  2. Click on the manage plugins button

  3. Switch to Available and search gerrit trigger

  4. Install the plugin.

Gerrit Trigger Configuration

  1. Setup a user for Jenkins in Gerrit server. Follow the instructions here

  2. Specify the Gerrit server settings via Manage Jenkins > Gerrit Trigger. Fill in the server settings as the following figure.

After finishing the settings, click on the Test Connection button to see if the settings is fine.

Jenkins Job Configuration

  1. Go to the Job Configuration Page and check the gerrit event option in Build Triggers.

  2. Choose the preconfigured Gerrit server (set in the previous section).

    Check Non-Review Patches is used in this example so that everytime a patchset is created, this job is triggered.

  3. Fill in the project and branch to monitor

  4. Create a new patchset and the project will be built

References

Gerrit Trigger Plugin

Gerrit with Jenkins